from selenium import webdriver


def forefox_test():
    fox = webdriver.Firefox
    fox.get('https://www.baidu.com')
    fox.find_element_by_id("wk").send_keys("两会")
    fox.find_element_by_id("su").click()


# ChromeFriver开启无头模式
def chrome_headless():
    option = webdriver.ChromeOptions()
    option.add_argument("--headless")
    chrome = webdriver.Chrome(chrome_options=option)
    chrome.get("http://www.baidu.com")
    html = chrome.page_source
    print(html)


if __name__ == '__main__':
    chrome_headless()
